import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;


public class CreditCardTest {
	CreditCard credit;
	@Before
	public void setUp() throws Exception {
	}
	
	@After
	public void tearDown() throws Exception {
	}
	
	@Test
	public void testCreditCardStringStringStringStringString() {
		credit = new CreditCard("Bob Smith", "1 Main St.", "12345", "Tacoma", "USA");
		assertTrue(credit.getfLimit() == 2500);
	}
	
	@Test
	public void testCreditCardStringStringStringStringStringDoubleCheckingAccount() {
		CheckingAccount checking = new CheckingAccount("name", "street", "12587", "town", "country", 357950);

		credit = new CreditCard("Bob Smith", "1 Main St.", "12345", "Tacoma", "USA", 50000.00, checking);
		assertTrue(credit.getfLimit() == 50000);

	}
	
	@Test
	public void testPay() {
		credit = new CreditCard("Bob Smith", "1 Main St.", "12345", "Tacoma", "USA");
		assertTrue(credit.getfLimit() == 2500);
		assertTrue(credit.pay(2000));
		assertFalse(credit.pay(2000));
	}
	
}
